using System.Collections;
using System.Windows;
using System.Windows.Controls;

namespace Select.Control.FormItem;

public partial class SelectSingleFormItem : UserControl
{
    public string Label { get; set; }

    public static readonly DependencyProperty OptionsProperty =
        DependencyProperty.Register("Options", typeof(IEnumerable), typeof(SelectSingleFormItem), new PropertyMetadata(null));

    public IEnumerable Options
    {
        get => (IEnumerable)GetValue(OptionsProperty);
        set => SetValue(OptionsProperty, value);
    }
    
    public static readonly DependencyProperty SelectedItemProperty =
        DependencyProperty.Register("SelectedItem", typeof(object), typeof(SelectSingleFormItem),
            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));

    public object SelectedItem
    {
        get => GetValue(SelectedItemProperty);
        set => SetValue(SelectedItemProperty, value);
    }

    public SelectSingleFormItem()
    {
        InitializeComponent();
    }
}